<template>
  <div class="about">
    <h1>This is an about page</h1>
    <!--    <router-link to="https://xchina.co/fiction/id-5fb6d15608315.html">-->
    <!--      测试-->
    <!--    </router-link>-->
    <!--    <router-view/>-->
    <a-button @click="testaxios">
      测试
    </a-button>
    {{code}}
    {{msg}}
    {{Id}}
    {{Name}}
  </div>
</template>
<script>
import ant from "ant-design-vue"


export default {
  name: "about",
    data(){
     return {
       msg:"",
       code:"",
       Id:"",
       Name:"",
     }


    },
  //三个函数比较
  created() {
    this.testaxios()
  },
  components: {
    [ant.name]: ant,

  },
  methods: {
    testaxios() {
      //
      this.$ajax.get("/v1/api").then((res) => {
        console.log(res)
        console.log(res.data.userd)
        this.code=res.data.code
        this.msg=res.data.msg
        this.Id=res.data.userd.Id
        this.Name=res.data.userd.Name
        //把路由设置成全局(重定向 2)
        // this.$router.push("/")
      }).catch(function (data) {
        console.log(data)
      })
    }
  }
}
</script>